package com.kws.merchant.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.kws.merchant.domain.PlatformInfoEntity;
import com.kws.merchant.mapper.PlatformInfoMapper;
import com.kws.merchant.service.PlatformInfoService;
import org.springframework.stereotype.Service;

/**
 * @author : zhangbenting
 * @date : 2024/12/14 16:05
 * @Version: 1.0
 */
@Service
public class PlatformInfoServiceImpl extends ServiceImpl<PlatformInfoMapper, PlatformInfoEntity> implements PlatformInfoService {

    @Override
    public PlatformInfoEntity getPlatformInfo(String titleName) {
        LambdaQueryWrapper<PlatformInfoEntity> wrapper = Wrappers.lambdaQuery();
        wrapper.eq(PlatformInfoEntity::getTitleName, titleName);
        PlatformInfoEntity platformInfo = this.getOne(wrapper);
        if (ObjectUtils.isNotNull(platformInfo)) {
            return platformInfo;
        }
        return new PlatformInfoEntity();
    }
}
